const express = require("express")

const app = express()

app.get("/products/:id/:name", (req, res, next) => {
  console.log(req.params);
  res.end("end")
})

app.get("/login", (req, res, next) => {
  console.log(req.query);
  //设置响应码
  res.status(204)

  // res.type("application/json")
  // res.end(JSON.stringify({ name: "zyw", age: 18 }))
  res.json({ name: "zyw", age: 18 })
})

app.listen(8000, () => {
  console.log(" 服务器启动成功");
})